package com.xianggu.designMode.chainMethod.demo04.impl;

import com.xianggu.designMode.chainMethod.demo03.Order;
import com.xianggu.designMode.chainMethod.demo04.HandlerFailureListener;

// 日志记录器：将失败信息记录到日志
public class LoggingListener implements HandlerFailureListener {
    @Override
    public void onFailure(Order order, String failedStep) {
        System.out.printf("[日志] 订单 %s 在环节 %s 处理失败，用户ID：%s%n", 
            order.getOrderId(), failedStep, order.getUserId());
    }
}